The present invention relates to an apparatus and method for controlling an internal combustion engine that statistically process the output of a sensor that detects the operating state of the internal combustion engine, and control the operation of the internal combustion engine using the result obtained by the statistical process.
When controlling the operation of an internal combustion engine, it is often necessary to statistically process the output of a sensor that detects the operating state of the internal combustion engine. For example, in knock determination as disclosed in Japanese Examined Patent Publication No. 6-60621, the output of a knock sensor is sampled at every ignition to extract a peak value. Knock occurrence is determined by analyzing the distribution profile of a value obtained by logarithmic conversion of the peak value using a statistical method to correct a knock determination threshold value.
In general, a mean and a standard deviation σ are used as indexes for determining the distribution profile of the data values using the statistical method. The standard deviation σ is the square root of a variance V and is widely used as the index representing the degree of spread of the data values. The variance V is the sum of the squared deviations between each data value and the mean divided by the number of the data values.
For example, when the data values the number of which is n are assumed to be X1, X2, . . . Xn, the mean Xav, the variance V, the standard deviation σ are defined as follows.Mean Xav=(X1+X2+ . . . +Xn)/nVariance V={(X1−Xav)2+(X2−Xav)2+ . . . +(Xn−Xav)2}/nStandard deviation σ=√V
When computing the mean Xav and the standard deviation σ using the definitional equations, a huge RAM capacity is required to store a large amount of data values obtained during a predetermined period. As an engine control, in a system that requires updating various types of information at every ignition or fuel injection in each cylinder, the RAM capacity that can be used for computation of the mean Xav and the standard deviation σ is limited. Therefore, in reality, it is difficult to simply execute the computation method that uses the definitional equations.
When the operating condition of the engine is changed, the output of the knock sensor and its peak value are also changed. Therefore, if the engine operating condition is changed while the data values of the peak value is being stored in the RAM, the mean Xav and the standard deviation σ including different engine operating conditions are undesirably computed, resulting in deterioration of the accuracy of the mean Xav and the standard deviation σ. That is, in the computation method that uses the definitional equations, the trackability of the mean Xav and standard deviation σ in a transient state is insufficient.
Therefore, in the above publication No. 6-60621, when determining the distribution profile of the value obtained by logarithmic conversion of the peak value of the output from the knock sensor, instead of computing the mean Xav and the standard deviation σ, the cumulative 10% point, cumulative 50% point, and cumulative 90% point of the distribution are updated at every ignition to determine the knock occurrence in accordance with the ratio of the cumulative 10% point, cumulative 50% point, and cumulative 90% point.
It is possible to approximately compute the mean Xav and the standard deviation σ using the cumulative % point. However, since the characteristic of the knock occurrence appears at the top cumulative percentage point of the distribution (for example the cumulative 97% point), it is necessary to compute the mean Xav and the standard deviation σ using the top cumulative percentage point (for example cumulative 97% point) to reflect the characteristic of the knock occurrence in the computed values of the mean Xav and the standard deviation σ. However, even if the frequency of occurrence of knocks is the same, since the variation range of the degree of knock (the greatness of peak value) is great, the top cumulative percentage point tends to vary greatly. Therefore, when computing the mean Xav and the standard deviation σ using the top cumulative percentage point, variation of the top cumulative percentage point is likely to cause the computed values of the mean Xav and the standard deviation σ to deviate from the true values.